package main.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import main.offender.Offender;
import main.taxevation.TaxEvation.Account;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

/**
 * 
 * Die Verbrechen Basis-Klasse.
 * 
 * 
 * @author spoeck
 *
 */
public class Crime  {

    

    private static int nextID = 1;

	private int id;

	private ObservableList<Offender> offenderList;

	private String shortDescription;
	
	
	public Crime() {

		id = nextID++;

	}

	public Crime(ObservableList<Offender> offenderList, String shortDescription) {
		this();
		this.offenderList = offenderList;
		this.shortDescription = shortDescription;

	}

	public int getId() {
		return id;
	}

	public ObservableList<Offender> getOffenderList() {

		if (offenderList == null) {
			offenderList = FXCollections
					.observableArrayList(new ArrayList<Offender>());
		}

		return offenderList;
	}

	public void setOffenderList(ObservableList<Offender> offenderList) {
		this.offenderList = offenderList;
	}



	@Override
	public boolean equals(Object obj) {
		if (obj == null)
			return false;
		if (obj == this)
			return true;
		if (this.getClass() != obj.getClass())
			return false;
		Crime crime = (Crime) obj;
		if (this.id == (crime.getId()))
			return true;
		return false;
	}

	@Override
	public int hashCode() {
		return this.id;

	}

    public String getShortDescription() {

        return shortDescription;
    }

    public void setShortDescription(String shortDescription) {

        this.shortDescription = shortDescription;
    }

}
